<?php
/*$this->breadcrumbs=array(
		Yii::t('ShopModule.shop', 'Categories')=>array('index'),
		Yii::t('ShopModule.shop', 'Create'),
		);

*/?><!--
<div id="shopcontent">

<h1> <?php /*echo Yii::t('ShopModule.shop', 'Create Category'); */?> </h1>

<?php /*echo $this->renderPartial('_form', array('model'=>$model)); */?>

</div>-->

<?php
$subCategories = Category::model()->findAll('is_submenu = 1');
?>

<!-- BEGIN PAGE CONTAINER-->
<div class="container-fluid">
    <!-- BEGIN PAGE HEADER-->
    <div class="row-fluid">
        <div class="span12">
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <h3 class="page-title">
                Quản lý menu sản phẩm
            </h3>
            <ul class="breadcrumb">
                <li>
                    <i class="icon-home"></i>
                    <a href="index.html">Trang chủ</a>
                    <i class="icon-angle-right"></i>
                </li>
                <li>
                    <a href="#">Menu sản phẩm</a>
                    <i class="icon-angle-right"></i>
                </li>
                <li><a href="#">Danh mục menu</a></li>
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->
        </div>
    </div>
    <!-- END PAGE HEADER-->
    <!-- BEGIN PAGE CONTENT-->
    <div class="row-fluid">
        <div class="span12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box light-grey">
                <div class="portlet-title">
                    <h4><i class="icon-plus-sign"></i>Edit menu sản phẩm</h4>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <!-- BEGIN FORM-->
                    <form action="/admin/category/update/id/<?php echo $model->category_id?>" class="horizontal-form" method="post">
                        <div class="row-fluid">
                            <div class="span6 ">
                                <div class="control-group">
                                    <label class="control-label" for="firstName">Tên menu</label>
                                    <div class="controls">
                                        <input type="hidden" name="Category[category_id]" value="<?php echo $model->category_id?>">
                                        <input type="text" id="firstName" class="m-wrap span12" placeholder="<?php echo $model->title?>" name="Category[title]" value="<?php echo $model->title?>">
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                            <div class="span6 ">
                                <div class="control-group">
                                    <label class="control-label" for="lastName">Thêm sub menu</label>
                                    <div class="controls">
                                        <select style="width:80%"class="span6 m-wrap" multiple="multiple" data-placeholder="Choose a Category" tabindex="1" name="Category[listSubmenu][]">
                                            <option value="0">None</option>
                                            <?php if($subCategories) {
                                                foreach($subCategories as $category) {?>
                                                    <option <?php if(in_array($category->category_id, $subCatId)) echo 'selected="selected"';?> value="<?php echo $category->category_id?>"><?php echo $category->title?></option>
                                                <?php }
                                            }?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                        </div>
                        <!--/row-->

                        <div class="form-actions">
                            <button type="submit" class="btn blue"><i class="icon-ok"></i> Lưu</button>
                            <button type="button" class="btn" onclick="window.location='/admin/category/admin'">Hủy</button>
                        </div>
                    </form>
                    <!-- END FORM-->
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>

    <!-- END PAGE CONTENT-->
</div>
<!-- END PAGE CONTAINER-->
